package cn.codingjc.aurora.module.system.biz.api.oauth;

import me.zhyd.oauth.model.AuthCallback;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/oauth")
public interface Oauth2Api {

    /**
     * 登陆
     * @param httpServletResponse
     * @return 认证地址
     */
    @GetMapping("/login")
    String login(HttpServletResponse httpServletResponse);

    /**
     * 回调
     * @param code 授权码
     * @param callback 回调
     * @return
     */
    @GetMapping("/callback")
    String callback(String code, AuthCallback callback);

    @GetMapping("/login2")
    String redirectToOAuthLogin();

    @GetMapping("/hello")
    String hello();
}

